<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="app">
    <comp></comp>
    <comp></comp>
    <comp ref="re"></comp>
    <button @click="btnClick">按钮</button>
</div>

<template id="comp">
    <div>
        <h1>Hello World  你好 </h1>
    </div>
</template>
<script>
    let vm = new Vue({
        el:'#app',
        data:{
            message:'丽丽',
            list:['111','222','333']
        },
        methods:{
            btnClick(){
                console.log(this.$children[0].msg)
                console.log(this.$refs.re.msg)
            }
        },
        components:{
            comp:{
                template:'#comp',
                data(){
                    return{
                        msg:'我是子组件'
                    }
                }
            }
        }
    })
</script>
</body>
</html>
